import React from 'react';
import { Card, Descriptions } from 'antd';

export default function Profile({ user }) {
  if (!user) return <div style={{ color: '#bbb', textAlign: 'center', marginTop: 40 }}>未获取到用户信息</div>;
  return (
    <Card title="个人中心" style={{ maxWidth: 500, margin: '0 auto' }}>
      <Descriptions column={1} bordered>
        <Descriptions.Item label="用户名">{user.username}</Descriptions.Item>
        <Descriptions.Item label="姓名">{user.real_name}</Descriptions.Item>
        <Descriptions.Item label="手机号">{user.phone}</Descriptions.Item>
        <Descriptions.Item label="角色">{user.role}</Descriptions.Item>
      </Descriptions>
    </Card>
  );
} 